package com.qf.auth.feign;

import com.qf.common.bean.R;
import org.apache.ibatis.annotations.Param;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author 千锋健哥
 */
@FeignClient(name = "qf-center-data")
public interface CheckCodeFeign {

    /**
     * 保存短信验证码到redis中
     * @return
     */
    @PostMapping("/data/checkcode/saveToRedis")
    public R saveToRedis(@RequestParam(value = "phone") String phone
            , @RequestParam(value = "code")String code);

    /**
     * 根据手机号获取验证码
     * @param phone
     * @return
     */
    @GetMapping("/data/checkcode/getCode/{phone}")
    public R<String> getCode(@PathVariable(value = "phone") String phone);
}
